package com.zhinong.mapper;


import com.github.pagehelper.Page;
import com.zhinong.dto.ExpertPageQueryDTO;
import com.zhinong.entity.Expert;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ExpertMapper {
    Page<Expert> pageQuery(ExpertPageQueryDTO expertPageQueryDTO);


    @Select("select * from expert where id = #{id}")
    Expert getById(Long id);

    @Insert("insert into expert(name,phone,sex,skill,status,avatar,description)values(#{name}, #{phone}, #{sex}, #{skill}, #{status}, #{avatar}, #{description})")
    void save(Expert expert);

    void update(Expert expert);

    @Delete("delete from expert where id = #{id}")
    void deleteById(Long id);
}
